Get words count in a string using VB.NET

Below is a simple function that takes one string argument and returns the word count in that string. In this function, we will use the following VB.NET built-in function: UBound: a function that returns the highest subscript for the indicated dimension of an array. Split: a function that splits strings. It extracts the substrings from... » read more

Create an Auto-complete ComboBox using VB.NET

This tutorial will teach you how to create an auto-complete ComboBox in a WinForm application. Auto-complete ComboBox is very useful when there are too many items in it. Auto-complete ComboBox using VB.NET First, we need to create a SQL Server database: Design View Data View Related Auto-Complete ComboBox Using C# Now open visual studio and... » read more

Socket connect and data send using C#

This tutorial will explain how to connect to a host machine, and then send data via TCP Socket. First, we need to add the namespaces: using System.Net; using System.Net.Sockets; And the function: public static void SendData(string data, Int32 port, string ips) { IPAddress host = IPAddress.Parse(ips);// IPEndPoint ipendpoint = new IPEndPoint(host, port); // assign host... » read more

Bind an ADO.NET DataTable to a TreeView using VB.NET

In this example, we will teach you how to bind a TreeView using a DataTable in Vb.NET. First, create a WinForm Project in Visual Studio, Select Vb.NET as the language. Then, add a TreeView control to the main form. DataBase And the Code: VB.NET Sub BindTreeView() Dim connetionString = "Data Source=TutorialsPanel-DB\SQLEXPRESS; Initial Catalog=TutorialsPanel;Integrated Security=True;" Dim... » read more

Bind an ADO.NET DataTable to a ListBox using VB.NET

The example below shows us how to bind a ListBox using vb.NET. The ListBox comes from System.Windows.Controls namespace. It’s a list of items that can be selected. First, create a new Visual Studio Project using VB.NET, then add a list box control to the main form as shown below: For this example we will use... » read more

Function Returns DataTable Using C#

Below is a function that returns a DataTable using in C#. DataTables are derived from the namespace System.Data. We will also use a DataAdapter in this example. The DataAdapter Fills the DataTable from a SQL Database based on a SQL Query which is defined in a SQLCommand. Database C# protected DataTable GetAllRecords() { SqlConnection sqlconn... » read more

Get computer name using C#

To get a computer name in C#, use the property MachineName from the Environment Class: C# strComputerName = Environment.MachineName.ToString(); The Environment class is inherited from the System.Object. It provides information about the current platform and environment of the executable application. Related Articles

Auto-Complete ComboBox Using C#

A combo-box is a window form control that developers use for better user experience. It’s a combination of a dropdown list and a text box. It allows the user to select the desired item or directly type a value into the control. To better understand this tutorial, you should know following C# programming areas:  C#... » read more

C# Array Tutorial

An array is a data structure that can store a fixes sized collection of elements that belong to the same data type. For example, an array can store a sequence of numbers that starts from 1 to 10. Each item has an index that is represented by a number. For example: arr [0] represents the... » read more